package demo1;

public class Main {
    public static void main(String[] args) throws InterruptedException {
        MyTimer myTimer=new MyTimer();
        myTimer.schedule(new Runnable() {
            @Override
            public void run() {
                System.out.println("任务1： "+Thread.currentThread().getName());
            }
        },0);
        myTimer.schedule(new Runnable() {
            @Override
            public void run() {
                System.out.println("任务2： "+Thread.currentThread().getName());
            }
        },1000);
        myTimer.schedule(new Runnable() {
            @Override
            public void run() {
                System.out.println("任务3： "+Thread.currentThread().getName());
            }
        },2000);
    }
}
